GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
GmElementDof Class Reference

A class to represent the degrees of freedom associated with each node of an element as seen by a physics object. More...

#include <gmElementDof.h>

Inheritance diagram for GmElementDof:
Collaboration diagram for GmElementDof:

Public Member Functions

 GmElementDof (GmCellType type, const QVector< int > &dofList=QVector< int >())
 Constructor for a GmElementDof based on element type. Creates an element with the number of nodes given by the element type. Suitable only if the element does not have ghost nodes (with dof).
 
 GmElementDof (int numNodes, const QVector< int > &dofList=QVector< int >())
 Constructor for a GmElementDof based on element number of nodes.

 
 ~GmElementDof ()
 Destructor.
 
virtual int numDof () const
 Returns the total number of dofs for this element.
 
int numNodes () const
 Returns the number of nodes in the element (which can contain ghost nodes)
 
int node (int columnIndex) const
 Given a 'matrix column' index, returns the associated node.
 
virtual int dof (int columnIndex) const
 Given a 'matrix column' index, returns the associated dof.
 
GmElementDofMap nodeDofMap (int node) const
 Returns the dof map for the requested element local node.
 
QVector< int > nodeDofList (int node) const
 Returns the dof list for the requested element local node. This function is slow and creates a new list when called.
 
GmElementDofMap elementDofMap () const
 Returns a map with the union of the maps of each of the elements nodes.
 
void setNodeDofUnsafe (int node, const QVector< int > &dofList)
 Replaces the dof map associated to an element node, receiving as input a list with VALID dof numbers (between 0 and GM_MAX_DOF), in their specified element order. Unsafe version does not check for thread safety (assert).
 
void setNodeDof (int node, const QVector< int > &dofList)
 
void addNode (const QVector< int > &dofList)
 
void addNodeUnsafe (const QVector< int > &dofList)
 Adds a new (ghost) node to the element dof map, initializing its dof list with the given dofs. The list should contain VALID dof numbers (between 0 and GM_MAX_DOF), in their specified element order. Unsafe version does not check for thread safety (assert).
 
- Public Member Functions inherited from GmDofMap

Private Member Functions

void init (int numNodes, const QVector< int > &dofList)
 Helper function for constructing the object. See parameters in the constructor description.
 
GmElementDofMap dofMapFromList (const QVector< int > &dofList) const
 Given a list with VALID dof numbers (between 0 and GM_MAX_DOF), returns a dof map representing the list.
 

Private Attributes

int _ndof
 The total number of dof for this element type.
 
QVector< GmElementDofMap_nodeMaps
 Vector storing the dof map for each element node.
 
QVector< int > _columnNodeList
 Vector indexed by 'matrix column' storing the column respective node number. Size equal to numDof().
 
QVector< int > _columnDofList
 Vector indexed by 'matrix column' storing the column respective dof number. Size equal to numDof().
 

Detailed Description

A class to represent the degrees of freedom associated with each node of an element as seen by a physics object.

For each node, dofs are stored as a bit map, represented by the GmElementDofMap type, where bit 'i' turned on means that dof 'i' is associated with that node.

The element number of nodes can be greater then the standard node number for the element type, allowing for dofs associated with ghost nodes. It can also change over time when a ghost node is added to an element.

To allow for efficient translation of 'column indices' into their respective node and dof values, the same information is also stored in two lists, one storing node numbers and the other dof values. Those lists have size equal to the number of dofs for the entire element and are ordered by node, with the order inside each node group defined by the dof order in the list used to set dofs per node.

The list representation stores dof order while the bit representation is a compact one that makes it easy to combine node information from several elements in situation where the order is not important.

Constructor & Destructor Documentation

◆ GmElementDof() [1/2]

GmElementDof::GmElementDof ( GmCellType type,
const QVector< int > & dofList = QVector<int>() )

Constructor for a GmElementDof based on element type. Creates an element with the number of nodes given by the element type. Suitable only if the element does not have ghost nodes (with dof).

Parameters
typeThe type of element we are storing dof maps for
dofIf different from an empty list, specifies the dof numbers that should be associated to every node in the element in the given order. List entries MUST be valid dof numbers (between 0 and GM_MAX_DOF). If the list is empty, the object wil be constructed with an empty map associated with every node.

◆ GmElementDof() [2/2]

GmElementDof::GmElementDof ( int numNodes,
const QVector< int > & dofList = QVector<int>() )

Constructor for a GmElementDof based on element number of nodes.

Parameters
numNodesThe number of node in the element we are storing dof maps for
dofIf different from an empty list, specifies the dof numbers that should be associated to every node in the element in the given order. List entries MUST be valid dof numbers (between 0 and GM_MAX_DOF). If the list is empty, the object wil be constructed with an empty map associated with every node.

Member Function Documentation

◆ dof()

virtual int GmElementDof::dof ( int columnIndex) const
inlinevirtual

Given a 'matrix column' index, returns the associated dof.

Column indices represent a position inside the ordered set of degrees of freedom associated to the element, the same order used when creating local element matrices. columnIndex must be a value less than numDof().

Implements GmDofMap.

◆ node()

int GmElementDof::node ( int columnIndex) const
inline

Given a 'matrix column' index, returns the associated node.

Column indices represent a position inside the ordered set of degrees of freedom associated to the element, the same order used when creating local element matrices. columnIndex must be a value less than numDof().

◆ numDof()

virtual int GmElementDof::numDof ( ) const
inlinevirtual

Returns the total number of dofs for this element.

Implements GmDofMap.


The documentation for this class was generated from the following files: